﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ACM_MAS_PAYMENT_Gernal.aspx.cs" Inherits="KPIS.GERP.GAMS.APP.App_UI.Forms.ACM_MAS_Payment_Gernal" %>

<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="head">
    <title>จำแนกรายการจ่ายที่เชื่อมโยงกับผังบัญชี</title>
    <link href="../CssClass.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Body" runat="server" contentplaceholderid="ContentPlaceHolder1" >

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
        OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel2" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel4" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Panel2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel2" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel4" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Panel4">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel2" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel4" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
        
            function openWin()
            {
                var oWnd = radopen("ACM_POPUP.aspx", "RadWindow1");
            }
            function OnClientClose(oWnd,args)
            {
                //get the transferred arguments
                var arg = args.get_argument();
                if(arg)
                { 
                    var account_seq = arg.account_seq;
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(account_seq);
                }
            }
             function OnTextChange(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }
        </script>
    </telerik:RadCodeBlock>
     <div class="moduleContent1000">
           <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel2" runat="server" CssClass="contentPaneDiv" Height="30px" ScrollBars="Auto" >
                      <div class = "RHeader">
                          <%--   <fieldset style= "width:350px;height:25px;">
                                  จำแนกงบรายจ่ายต่าง ๆ
                             </fieldset> --%>
                         </div>    
                             <table cellpadding="0" cellspacing="0" align = "right" >
                               <tr>
                                        <td><asp:Label ID="lblStatus" runat="server" Text="สถานะของข้อมูล" ForeColor="Orange" Font-Size="Large" Font-Bold="true"></asp:Label></td>
                                        <td width="100px" class="controls">
                                            <asp:LinkButton ID="btnSave" runat="server" CssClass="LinkButton" onclick="btnSave_Click" CausesValidation="true">
                                                <img alt="" id="imgSave" runat="server" src="~/App_UI/Images/Buttons/saveDisk.gif" title="บันทึกข้อมูล" width="17"/> บันทึกข้อมูล
                                            </asp:LinkButton>                                            
                                        </td>
                                        <td width="100px" class="controls">
                                            <asp:LinkButton ID="btnCancel" runat="server" CssClass="LinkButton" onclick="btnCancel_Click" CausesValidation="False">
                                                <img alt="" id="imgCancel" runat="server" src="~/App_UI/Images/Buttons/Cancel.gif" title="ยกเลิกการแก้ไข" width="17"/> ยกเลิกการแก้ไข
                                            </asp:LinkButton>
                                        </td>
                               </tr>
                            </table> 
                 </asp:Panel>
           </div>
     </div>          
     
     <div class="moduleContent1000">
       <div class="moduleDivBottom1000">
               <asp:Panel ID="Panel1" runat="server" CssClass="contentPaneDiv" Height="1044px" ScrollBars="Auto" >    
                           <table>
                                 <tr>
                                            <td>
                                                  <div class ="moduleContent490" >
                                                    <div class="moduleDivBottom490">
                                                          <asp:Panel ID="Panel4" runat="server" CssClass="contentPaneDiv" Height="1000px" Width="465px" ScrollBars="Auto" align = "left" >    
                                                                <table>
                                                                             <tr>
                                                                                        <td>
                                                                                              <span class="TextHeaderSmallBlack">งบบัญชีรายจ่าย</span>
                                                                                        </td>
                                                                             </tr>
                                                                             <tr>
                                                                                        <td>
                                                                                               <telerik:RadComboBox ID="cmbExpenseGroup" Runat="server" AutoPostBack="True" 
                                                                                                    DataTextField="exp_grp_name" DataValueField="bgm_exp_grp_seq" 
                                                                                                    Filter="Contains" DropDownWidth="250px" EmptyMessage="< กรุณาเลือกกลุ่มของค่าใช้จ่าย >"
                                                                                                    OnSelectedIndexChanged="cmbExpenseGroup_SelectedIndexChanged"
                                                                                                    Width="250" >
                                                                                               </telerik:RadComboBox>
                                                                                        </td>
                                                                             </tr>
                                                                             <tr>
                                                                                        <td valign="top">
                                                                                          <asp:Panel ID="Panel3" runat="server" CssClass="contentPaneDiv" Height="900px" ScrollBars="Auto" >
                                                                                             <telerik:RadTreeView ID="radTreeviewExpense" Runat="server" Skin="WebBlue" 
                                                                                                   DataFieldID="bgm_exp_seq" DataFieldParentID="upper_bgm_exp_seq"
                                                                                                   DataTextField="bgm_exp_name" DataValueField="bgm_exp_seq" OnNodeClick="radTreeviewExpense_NodeClick" >
                                                                                             </telerik:RadTreeView>
                                                                                          </asp:Panel>
                                                                                       </td>
                                                                             </tr>   
                                                                </table>
                                                          </asp:Panel>
                                                   </div>
                                                </div>                
                                            </td>
                                            <td>
                                                          <asp:Panel ID="Panel5" runat="server" CssClass="contentPaneDiv" Height="1000px" Width="455" ScrollBars="Auto" align = "center" >    
                                                                  <telerik:RadGrid ID="grdPaymentGernal" runat="server" AutoGenerateColumns="false"
                                                                AllowMultiRowEdit="false" AllowMultiRowSelection="true" 
                                                                Width="430px" Height="322px" AllowPaging="true" AllowFilteringByColumn="true"
                                                                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                                GroupingSettings-GroupContinuedFormatString=""
                                                                GroupingSettings-GroupContinuesFormatString=""
                                                                GroupingSettings-GroupSplitFormat="" PageSize="10"
                                                                OnNeedDataSource="grdPaymentGernal_NeedDataSource" 
                                                                OnItemCommand="grdPaymentGernal_ItemCommand" align ="left">
                                                                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                                                                    DataKeyNames="bgm_exp_seq" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                                                                    <RowIndicatorColumn>
                                                                        <HeaderStyle Width="20px" />
                                                                    </RowIndicatorColumn>
                                                                    <ExpandCollapseColumn>
                                                                        <HeaderStyle Width="20px" />
                                                                    </ExpandCollapseColumn>
                                                                    <Columns>   
                                                                        <telerik:GridTemplateColumn HeaderText="แก้ไข" AllowFiltering="false" HeaderStyle-Width="35px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"> 
                                                                            <FilterTemplate></FilterTemplate>
                                                                            <ItemTemplate>&nbsp;&nbsp;&nbsp;
                                                                                <asp:ImageButton ID="cmdEdit" runat="server" CommandName="DataEdit"
                                                                                    ImageUrl="~/App_UI/Images/Buttons/Edit.gif" 
                                                                                    ToolTip="แก้ไขรายการ" width="17" />
                                                                            </ItemTemplate>
                                                                        </telerik:GridTemplateColumn>
                                                                        <telerik:GridBoundColumn DataField="bgm_exp_seq" 
                                                                            HeaderText="bgm_exp_seq" UniqueName="bgm_exp_seq"
                                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" Visible="false" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="account_seq" 
                                                                            HeaderText="account_seq" UniqueName="account_seq"
                                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" Visible="false" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="bgm_exp_name" 
                                                                            HeaderText="ชื่องบรายจ่าย" UniqueName="bgm_exp_name"
                                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                            HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                        </telerik:GridBoundColumn><%--HeaderStyle-Width="200px"--%>
                                                                        <telerik:GridBoundColumn DataField="bgm_exp_descr" 
                                                                            HeaderText="bgm_exp_descr" UniqueName="bgm_exp_descr"
                                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" Visible="false" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="account_name"
                                                                            HeaderText="บัญชีค่าใช้จ่าย"
                                                                            FilterControlWidth="100%" AutoPostBackOnFilter="true" HeaderStyle-Width="200px"
                                                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                        </telerik:GridBoundColumn>
                                                                    </Columns>
                                                                    <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                                                                FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                                                NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                                                PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" /> 
                                                                        </MasterTableView>
                                                                        <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                                                          GroupContinuedFormatString="" GroupContinuesFormatString="" 
                                                                                          GroupSplitFormat=""/>
                                                                        <ClientSettings EnableRowHoverStyle="True">
                                                                            <Selecting AllowRowSelect="true" />
                                                                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                                                        </ClientSettings>
                                                             </telerik:RadGrid>     
                                                                   <br /><br />
                                                                   <fieldset style="width:430px; height: 180px" >
                                                                          <legend><asp:Label runat="server" Text="แก้ไขรายการ" Font-Bold="true"/></legend>
                                                                            <table align ="left" >
                                                                               <tr>
                                                                                  <td colspan="9" rowspan="22"></td>
                                                                               </tr>
                                                                               <tr>
                                                                                  <td align="left"><asp:Label runat="server" ID="lblExpenseCode" Text ="รหัสรายจ่าย :" Font-Bold="true"/>
                                                                                  </td>
                                                                                  <td align="left"><telerik:RadTextBox ID="txtExpenseCode" runat="server" title="รหัสรายจ่าย" Width="250" Enabled="false"></telerik:RadTextBox>
                                                                                  </td>
                                                                               </tr> 
                                                                               <tr>
                                                                                  <td align="left"><asp:Label runat="server" ID="lblExpenseName" Text ="ชื่องบรายจ่าย :" Font-Bold="true"/>
                                                                                  </td>
                                                                                  <td align="left"><telerik:RadTextBox ID="txtExpenseName" runat="server" title="ชื่องบรายจ่าย" Width="250" Enabled="false"></telerik:RadTextBox>
                                                                                  </td>
                                                                               </tr>  
                                                                                <tr>
                                                                                      <td align="left"><asp:Label runat="server" ID="lblAccountCode" Text ="บัญชีค่าใช้จ่าย :" Font-Bold="true"/>
                                                                                      </td>
                                                                                      <td align="left">
                                                                                         <%-- <telerik:RadComboBox ID="cmbAccountCode" Runat="server" 
                                                                                                    DataTextField="account_code_name" DataValueField="account_seq" 
                                                                                                    Filter="Contains" DropDownWidth="350px" EmptyMessage="< กรุณาเลือกรหัสบัญชี >"
                                                                                                     Width="250" Enabled="false">
                                                                                          </telerik:RadComboBox>--%>
                                                                                           <telerik:RadComboBox ID="cmbAccountCode" Runat="server"
                                                                                                    DataTextField="account_code_name" DataValueField="account_seq" 
                                                                                                    EnableLoadOnDemand="true" 
                                                                                                    ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                                                                                                    EmptyMessage="< เลือกรายการรหัสบัญชี >" AllowCustomText="true" Filter="Contains"
                                                                                                    OnClientTextChange="OnTextChange"
                                                                                                    OnItemsRequested="cmbAccountCode_ItemsRequested" Width="250px" title="รหัสบัญชีค่าใช้จ่ายระหว่างหน่วยงาน">
                                                                                         </telerik:RadComboBox>
                                                                                          <span class="span">&nbsp;*</span>
                                                                                      </td>
                                                                                      <td>
                                                                                          <asp:ImageButton ID="btnAccountSearch" runat="server" ImageUrl="~/App_UI/Images/Buttons/Search.png" Width="20px"
                                                                                            OnClientClick="openWin()" />
                                                                                          <telerik:RadTextBox ID="txtAccountCode" runat="server" title="รหัสบัญชีสินทรัพย์" Width="50" Enabled="false" Visible="false"></telerik:RadTextBox>
                                                                                      </td>
                                                                               </tr>  
                                                                               <tr>
                                                                                      <td align="left" valign="top"><asp:Label runat="server" ID="lblExpense_Descr" Text ="รายละเอียดเพิ่มเติม :" Font-Bold="true"/>
                                                                                      </td>
                                                                                           <td align="left"><telerik:RadTextBox ID="txtExpense_Descr" runat="server" title="รายละเอียดเพิ่มเติม" Height="40" Width="250" Enabled="false"></telerik:RadTextBox>
                                                                                           <asp:Label runat= "server" ID = "hbgm_exp_seq" Visible ="false" />
                                                                                           <asp:Label runat= "server" ID = "hnode_tree" Visible = "false" />
                                                                                           <asp:Label runat= "server" ID = "hupper_bgm_exp_seq" Visible = "false" />
                                                                                      </td>
                                                                               </tr>  
                                                                            </table>
                                                               </fieldset>    
                                                          </asp:Panel>
                                            </td>
                                 </tr>
                           </table>   
               </asp:Panel>
       </div>         
     </div>
     <telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false" ReloadOnShow="true"
        runat="server" Skin="Vista">
        <Windows>
            <telerik:RadWindow runat="server" ID="RadWindow1"
                Width="639px" Height="625px"  Skin="Outlook" 
                VisibleStatusbar="true"
                OnClientClose="OnClientClose">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
</asp:Content>



